//
//  ShiciListVC.m
//  诗词鉴赏
//
//  Created by Steven on 2019/7/23.
//  Copyright © 2019 Steven. All rights reserved.
//

#import "ShiciListVC.h"
#import "Shici.h"
#import "DetailVC.h"

@interface ShiciListVC ()

@end

@implementation ShiciListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    [self.tableView addRefreshHeaderViewWithAniViewClass:nil beginRefresh:nil];
    
    self.tableView.tableFooterView = [UIView new];
}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.dataArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    Shici *model = self.dataArray[indexPath.row];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"shiciCell" forIndexPath:indexPath];
    cell.textLabel.text = model.title;
    cell.detailTextLabel.text = model.author;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    DetailVC *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailVC"];
    
    vc.model = self.dataArray[indexPath.row];
    
    [self.navigationController pushViewController:vc animated:YES];
    
    
}
@end
